<style type="text/css">
.CodeMirror{
	border:1px solid #ccc;
	{if $_rs.form_style}{$_rs.form_style};{/if}
	height:{$_rs.height};
}
.CodeMirror-scroll{
	width:{$_rs.width};
	{if $_rs.height == 'auto !important'}height: auto !important;{/if}
}
</style>
<table cellpadding="0" cellspacing="0" style="width:100%;height:auto;border:0;" border="0">
<tr>
	<td><textarea id="{$_rs.identifier}" name="{$_rs.identifier}" style="height:{$_rs.height};">{$_rs.content}</textarea></td>
</tr>
</table>
<script type="text/javascript">
var code_editor_{$_rs.identifier};
$(document).ready(function(){
	code_editor_{$_rs.identifier} = CodeMirror.fromTextArea(document.getElementById("{$_rs.identifier}"),{
		lineNumbers		: true,
		matchBrackets	: true,
		lineWrapping	: true,
		indentWithTabs	: true,
		indentUnit		: 4,
		theme			: '{$_rs.theme ? $_rs.theme : "default"}'
	}).on("change",function(obj){obj.save()});
});
</script>
<!-- if $_rs.js_admin -->
<script type="text/javascript">
$(document).ready(function(){
	{$_rs.js_admin}
});
</script>
<!-- /if -->